public class Computer {
    private String cpu;//cpu
    private String memory;//内存
    public String screen;//屏幕
    String brand;//品牌-->default属性

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public String getMemory() {
        return memory;
    }

    public void setMemory(String memory) {
        this.memory = memory;
    }

    public String getScreen() {
        return screen;
    }

    public void setScreen(String screen) {
        this.screen = screen;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public Computer(String brand, String cpu, String memory, String screen) {
        this.brand = brand;
        this.cpu = cpu;
        this.memory = memory;
        this.screen = screen;
    }

    public void powerOn() {
        System.out.println("开机!");
    }

    public void shutDown() {
        System.out.println("关机!");
    }

    public void surfInternet() {
        System.out.println("上网!");
    }
}

class TestComputer {
    public static void main(String[] args) {
        Computer p = new Computer("XM","r10","512","16寸");
        System.out.println(p.brand);//default属性：只能被本包中类访问
        System.out.println(p.screen);//public属性：可以被任何其他类访问
        //System.out.println(p.cpu);//private属性：只能在Computer类中访问，不能被其他类访问
    }
}